<?php
class Arm_Form_Element_Time extends Zend_Form_Element
{
  public function init(){
    parent::init();

    $this ->addValidator(new Zend_Validate_Regex('/^([0-1][0-9]|[2][0-3]):([0-5][0-9])$/'));
    $this ->setOptions(array(
      'size'        => 6,
      'maxlength'   => 5,
      'onkeyup'     => 'formTimeMasc(this.id)',
      'onblur'      => 'validateTime(this.id)',
    ));

    $this->addErrorMessage('Hora no formato inválido! Utilize, o formato 99:99');
    $this ->addFilter('StripTags');
    $this ->addFilter('StringTrim');
    $this ->addFilter('StringToLower');
  }
}
